﻿using System;
using TSL.DAL;
using TSL.Model;
using System.Data;

namespace TSL.BLL
{
    public class publish
    {
        private readonly TSL.DAL.publish dal = new TSL.DAL.publish();

        public DataSet GetToDay()
        {
            return dal.GetToDay();
        }

        /// <summary>
        ///删除超时有效时间内未刷新的用户
        /// </summary>
        public void DeleteOnline_ForRefreshTime(int ActiveTimeout)
        {
            dal.DeleteOnline_ForRefreshTime(ActiveTimeout);
        }

        /// <summary>
        ///增加用户登录日志
        /// </summary>
        public void AddUserLoginLog(string username, string user_IP, string UserBrowser)
        {
            try
            {
                TSL.Model.Login model = new TSL.Model.Login();
                TSL.BLL.Login dals = new TSL.BLL.Login();
                model.username = username;
                model.logip = user_IP;
                model.state = "100";
                model.browser = UserBrowser;
                model.state = "100";
                dals.AddLogin(model);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
